package org.example.weather.bigscreen.core.component;

import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

@Slf4j
@Getter
@Setter
@ConfigurationProperties(prefix = ShardingDataSourceProperties.PREFIX, ignoreInvalidFields = true)
public class ShardingDataSourceProperties {
    public static final String PREFIX = "spring.shardingsphere";

    @Value("${spring.shardingsphere.datasource.names}")
    private Set<String> names;

    private Map<String, DataSourceProperty> datasource = new LinkedHashMap<>();
}
